package com.zzb.framework.user.entity;

import com.baomidou.mybatisplus.annotations.KeySequence;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zzb.framework.common.BaseEntity;
import com.zzb.framework.role.entity.IUser;
import com.zzb.framework.validator.annotation.ValidateString;



/**
* 用户账号 实体类
*/
@TableName( "t_sys_user")
public class User extends BaseEntity<String> implements IUser<String> {
    @TableId(value = "id", type = IdType.UUID)
    private String id;
    @TableField(value = "login_name")
    @ValidateString(length = 16,msg = "用户名在15字符串以内")
    private String loginName; //用户名
    @TableField(value = "password")
    @ValidateString(method = ValidateString.ValidatorMethod.PASSWORD,msg = "密码验证必须是字母、数字，长度在6~16位之间")
    private String password; //密码

    /*----------------------get set 方法----------------------*/
    public String getId() {return id;}
    public void setId(String id) {this.id = id;}
    public String getLoginName() {return loginName;}
    public void setLoginName(String loginName){this.loginName = loginName == null ? null : loginName.trim();}
    public String getPassword() {return password;}
    public void setPassword(String password){this.password = password == null ? null : password.trim();}
    /*----------------------toString 方法----------------------*/
    @Override
    public String toString() {
        return "User{" +
        "id='" + getId() + '\'' + ',' + 
        "loginName='" + getLoginName() + '\'' + ',' + 
        "password='" + getPassword() + '\'' + ',' + 
        "createTime='" + getCreateTime() + '\'' + ',' +
        "creator='" + getCreator() + '\'' + ',' + 
        "updateTime='" + getUpdateTime() + '\'' + ',' + 
        "updater='" + getUpdater() + '\'' + ',' + 
        "activate='" + getActivate() + '\'' + 
        '}';
    }
}
